<!DOCTYPE html>
<html>
<head>
  <title><%= @page_title %> - Library University Of Techonology Ho Chi Minh City</title>
  <%= stylesheet_link_tag    "application", :media => "all" %>
  <%= javascript_include_tag "application" %>
  <%= csrf_meta_tags %>
</head>
<body>
	<div class="header">
       	<div class='topbar'>
       		<div class='center'>
       		<% if(session[:user_id]) %>
		      Welcome:&nbsp;
		      <span class='Welcome: '><%= link_to User.find(session[:user_id]).fullname, :controller => 'default/user', :action => 'profile' %> </span> &nbsp; | &nbsp;
		      <%= link_to "Logout", :controller => 'default/user', :action => 'logout' %>
		    <% else %>
		      <%= link_to "Login", :controller => 'default/user', :action => 'login' %>
		    <% end %>
		    </div>
       	</div>
       	<div class='banner'></div>        
        <div id="topnav">
            <ul>                                                                       
	            <li <% if params[:action] == 'index' and (!params[:all] or params[:all] == 'false') %><%= "class='selected'" %><% end %> ><%= link_to 'Home', :controller => 'default/book', :action => 'index' %></li>
	            <li <% if params[:action] == 'index' and params[:all] == 'true' %><%= "class='selected'" %><% end %>><%= link_to 'All Books', :controller => 'default/book', :action => 'index', :all => true %></li>
	            <li <% if params[:action] == 'search' %><%= "class='selected'" %><% end %>><%= link_to 'Search', :controller => 'default/book', :action => 'search' %></li>
	            <li><a href="about.html">Tutorial</a></li>
	            <li><a href="contact.html" class='last'> Contact</a></li>
            </ul>
        </div>
       </div> 
    <div id="wrap">
       <div class="center_content">
       	<div class="left_content">
           <%= yield %>
        </div><!--end of left content-->
        
        <div class="right_content">        	
             <div class="title"><span class="title_icon"><%=image_tag("bullet3.gif") %></span>Introduction</div> 
             <div class="about">
             <p>
             <%=image_tag("about.gif", :class => "right") %>
             Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud.
             </p>
             
             </div>
             
             <div class="right_box" style="width: 100%">
             	<div class="title"><span class="title_icon"><%=image_tag("bullet5.gif") %></span>Categories</div> 
                <% categories = BookCategory.all %>
                <ul class="list">
                	<% categories.each do |cate| %>
                	<li style="width: 100% !important; margin-bottom: 12px" <% if params[:cate].to_i == cate.id %><%= "class='selected'" %><% end %> >
                		<% 
                			if params[:all] == 'true'
                				p_all = true 
            				else 
            					p_all = false
            				end 
        				%>
                		<%= link_to cate.category_name, :controller => 'default/book', :action => 'index', :cate => cate.id, :all => p_all %>
                	</li>
                	<% end %>
                </ul>                
             </div>  <!-- End .right-box-->       
        </div><!--end of right content-->
       
       <div class="clear"></div>
       </div><!--end of center content-->
       
              
       <div class="footer">
	        <div class="right_footer">
		        <a href="index.html">home</a>
		        <a href="about.html">about us</a>
		        <a href="services.html">services</a>
		        <a href="privacy.html">privacy policy</a>
		        <a href="contact.html">contact us</a>
	        </div><!-- End .right-footer -->
       </div><!-- End .footer -->
</div>
</body>
</html>
